package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLByteList;
import HLLib.base.HLImage;
import HLLib.base.HLString;
import HLLib.http.HLANetFile;
import HLLib.io.HLFile;

public class HLClassImage extends HLLibClass {
    public HLClassImage(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLImage();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLImage) self).LoadAsynchronous((HLString)args.GetObject(0), (HLImage)args.GetObject(1), args.GetBoolean(0));
            break;
        }
        case 1: {
            ((HLImage) self).LoadAsynchronousAndSave((HLString)args.GetObject(0), (HLImage)args.GetObject(1), args.GetBoolean(0));
            break;
        }
        case 2: {
            ((HLImage) self).LoadAsynchronousEx((HLString)args.GetObject(0), args.GetBoolean(0));
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                ((HLImage) self).GetImage();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLImage) self).GetImage());
            }
            break;
        }
        case 4: {
            ((HLImage) self).SetSize(args.GetInt(0), args.GetInt(1));
            break;
        }
        case 5: {
            ((HLImage) self).StartLoad();
            break;
        }
        case 6: {
            ((HLImage) self).StartLoadCheckSave();
            break;
        }
        case 7: {
            ((HLImage) self).SetImage((HLImage)args.GetObject(0));
            break;
        }
        case 8: {
            if (resultOwnerObject == null) {
                ((HLImage) self).GetGraphics();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLImage) self).GetGraphics());
            }
            break;
        }
        case 9: {
            if (resultOwnerObject == null) {
                ((HLImage) self).GetWidth();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLImage) self).GetWidth());
            }
            break;
        }
        case 10: {
            if (resultOwnerObject == null) {
                ((HLImage) self).GetHeight();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLImage) self).GetHeight());
            }
            break;
        }
        case 11: {
            ((HLImage) self).LoadFileAsynchronous();
            break;
        }
        case 12: {
            ((HLImage) self).LoadFileByAnother((HLANetFile)args.GetObject(0));
            break;
        }
        case 13: {
            ((HLImage) self).SetUrl((HLString)args.GetObject(0));
            break;
        }
        case 14: {
            if (resultOwnerObject == null) {
                ((HLImage) self).GetImageData();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLImage) self).GetImageData());
            }
            break;
        }
        }
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                HLImage.CreateAsynchronous((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLImage.CreateAsynchronous((HLString)args.GetObject(0)));
            }
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                HLImage.CreateImageFromSubByteList((HLByteList)args.GetObject(0), args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLImage.CreateImageFromSubByteList((HLByteList)args.GetObject(0), args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                HLImage.CreateImageFromPath((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLImage.CreateImageFromPath((HLString)args.GetObject(0)));
            }
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                HLImage.CreateImageFromFile((HLFile)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLImage.CreateImageFromFile((HLFile)args.GetObject(0)));
            }
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                HLImage.CreateImageFromByteList((HLByteList)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLImage.CreateImageFromByteList((HLByteList)args.GetObject(0)));
            }
            break;
        }
        case 5: {
            if (resultOwnerObject == null) {
                HLImage.CreateImageBySize(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLImage.CreateImageBySize(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 6: {
            if (resultOwnerObject == null) {
                HLImage.GetID(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLImage.GetID(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 7: {
            if (resultOwnerObject == null) {
                HLImage.CaptureScreen();
            } else {
                resultOwnerObject.SetObject(resultIndex, HLImage.CaptureScreen());
            }
            break;
        }
        case 8: {
            if (resultOwnerObject == null) {
                HLImage.GetUIImage((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLImage.GetUIImage((HLString)args.GetObject(0)));
            }
            break;
        }
        case 9: {
            HLImage.GetImageByPhotoAlumb(args.GetBoolean(0));
            break;
        }
        case 10: {
            HLImage.GetImageByCamera(args.GetBoolean(0));
            break;
        }
        }
    }
}
